﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using GWEB.WebBase.Entity;
using GWEB.WebBase.Utility;
using GWEB.WebFrame.Public;

namespace GWEB.WebFrame.Models
{
    public class Role
    {
        public PageInfo Init()
        {
            PageInfo pg = new PageInfo();
            pg.Type = "Role";
            pg.Title = "角色管理";
            pg.AddText = "角色增加";
            pg.EditText = "角色修改";
            pg.LocateText = "角色信息查询";
            pg.SMenuId = "CS03";
            pg.FileUrl = "../Sys/Role";
            pg.Condition = "";
            pg.TableName = "tb_sys_role";
            pg.KeyFieldName = "srolecode";
            pg.PopEditHeight = 290;
            pg.PopEditWidth = 360;
            HttpSessionState session = System.Web.HttpContext.Current.Session;
            pg.dict = BasePage.getDict(session);
            pg.Sop = BasePage.Grant(session, pg.SMenuId);
            pg.Sql = "select * from (select tb_sys_role.*,'查看' as link1 from tb_sys_role) tb_sys_role where 1=1";
            ColumnInfo cl;
            cl = new ColumnInfo(); cl.FieldName = "srolecode"; cl.HeadText = "角色ID";  cl.IsCondition = true; cl.IsCheck = true; cl.ErrMessage = "角色ID:必填且长度不能超过20"; cl.Length = 20; cl.IsNull = false; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.FieldName = "srolename"; cl.HeadText = "角色名称"; cl.IsCondition = true; cl.IsCheck = true; cl.ErrMessage = "角色名称:必填且长度不能超过40"; cl.Length = 40; cl.IsNull = false; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.FieldName = "smemo"; cl.HeadText = "备注"; cl.IsCondition = true; cl.IsCheck = true; cl.ErrMessage = "备注:长度不能超过80"; cl.Length = 80; pg.AddColumn(cl);
            return pg;
        }
    }
}